package com.javase.Homework;

public class Homework03 {
    public static void main(String[] args) {
        Book book = new Book("老子",200);
        System.out.println(book.name+"======="+book.price);
    }
}

class Book{
    String name;
    double price;
    public Book(String name,double price){
        this.name = name;
        this.price = price;
        this.updatePrice(price);
    }
    public double updatePrice(double price){
        if (price >= 150){
            this.price = 150;
        }else if (price >= 100){
            this.price = 100;
        }
        return price;
    }
}